package com.wuseguang.springcloud.service.impl;

import com.wuseguang.springcloud.dao.jdbc.CommodityJdbc;
import com.wuseguang.springcloud.service.CommodityService;
import com.wuseguang.springcloud.util.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 商品表 服务实现类
 * </p>
 *
 * @author 
 * @since 2020-09-21
 */
@Service
public class CommodityServiceImpl  implements CommodityService {

    public Logger logger  = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private CommodityJdbc commodityJdbc;

    @Override
    public Result findCommodity() {
        //查询商品sql
        String sql ="select id,commodity_name,commodity_price,vip_or_not,month,original_price from commodity";
        List<Map<String,Object>> list =commodityJdbc.queryListMap(sql);
        return new Result(list);
    }
}
